//
//  SHComposeButton.swift
//  SHWeibo
//
//  Created by jingming wang on 16/8/4.
//  Copyright © 2016年 cpy.name. All rights reserved.
//

import UIKit

class SHComposeButton: UIButton {
    // 模型
    var composeButtonInfo: SHComposeButtonInfo?
    // 干掉高亮效果
    override var highlighted: Bool {
        get {
            return false
        }
        set {
            
        }
    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
        
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    // MARK: - 设置视图
    private func setupUI() {
        imageView?.contentMode = .Center
        titleLabel?.textAlignment = .Center
        titleLabel?.font = Font(15)
        setTitleColor(UIColor.darkGrayColor(), forState: .Normal)
    }
    
    // MARK: - 重新布局子控件
    override func layoutSubviews() {
        super.layoutSubviews()
        
        imageView?.frame = CGRect(x: 0, y: 0, width: self.frame.width, height: self.frame.width)
        titleLabel?.frame = CGRect(x: 0, y: self.frame.width, width: self.frame.width, height: self.frame.height - self.frame.width)
    }
    
    
    
    
}
